<%@ page import="org.leaf.green.b2b.Purchase" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
    <title><g:message code="purchase.edit" default="Edit Purchase" /></title>
    <g:render template="/b2b/purchase/purchase/ajax_edit_header" />
</head>
<body>
<div class="nav">
    <span class="menuButton"><g:link class="list" action="list"><g:message code="purchase.list" default="Purchase List" /></g:link></span>
    <span class="menuButton"><g:link class="create" action="create"><g:message code="purchase.new" default="New Purchase" /></g:link></span>
</div>
<div class="body">
    <h1><g:message code="purchase.edit" default="Edit Purchase" /></h1>
    <g:if test="${flash.message}">
    <div class="message"><g:message code="${flash.message}" args="${flash.args}" default="${flash.defaultMessage}" /></div>
    </g:if>
    <g:hasErrors bean="${purchaseInstance}">
    <div class="errors">
        <g:renderErrors bean="${purchaseInstance}" as="list" />
    </div>
    </g:hasErrors>
    <g:form method="post" >
        <g:hiddenField name="id" value="${purchaseInstance?.id}" />
        <g:hiddenField name="version" value="${purchaseInstance?.version}" />
        <!--edit-->
        <g:render template="/b2b/purchase/purchase/edit" />
        <!--end edit-->
        <div class="buttons">
            <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'update', 'default': 'Update')}" /></span>
            <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'delete', 'default': 'Delete')}" onclick="return confirm('${message(code: 'delete.confirm', 'default': 'Are you sure?')}');" /></span>
        </div>
    </g:form>
</div>
</body>
</html>
